package com.demo.dao;

import com.demo.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {
    @Update("update user set name=#{name} ,age=#{age}  where id=#{id};")
    int update(User user);
    @Insert("insert into user (name,age) values (#{name} ,#{age} )")
    int add(User user);
    @Select("select * from user;")
    List<User> list();
    @Delete("delete from user where id=#{id} ;")
    int del(int id);
}
